<?php
//include('../../incsession.php');
include('rootlogin.php');
session_start();
$flag=0;
if(!isset($_POST['topic'])){

}else if($_POST['topic']==''){
	$flag=1;	
}else{
	$_SESSION['topic']=$_POST['topic'];	
	header("location: page.php");
}
//echo $_SESSION['topic'].$_POST['topic']."pp";


?>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../framestyle.css" type="text/css" media="screen">

</head>

<body>
<div id="wrapper">
<div id="title">Online Listening Comprehension Program</div>

<div id="main">

<form method = POST action="index.php" >

<hr/>
<div id="title2">CHOOSE A TOPIC TO EDIT</div>
<hr/>
<br><br>
<?php
if($flag==1){
		echo "<div id='error'>Please choose a topic.</div><br>";
}




$query = "SELECT * FROM topic";
$result = mysql_query($query,$user_con);



while($row = mysql_fetch_array($result)){
	echo "<Input type = 'Radio' Name ='topic' value='".$row['topicid']."'>".$row['name']."<br>";
}


?>


<br>
<div class="btn_right"><input type="submit" name = "next" value = "next"></div>
</form>
<form method = POST action="../index.php" >
<div class="btn_right"><input type="submit" name = "next" value = "back to index"></div>
<form>
</div>
</div>
</body>


